package com.gxp.pagehelper.controller;

import com.gxp.pagehelper.config.PageUtils;
import com.gxp.pagehelper.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class Test
{
    @Autowired
    private TestService ts;
    @ResponseBody
    public PageUtils getAllInfo(@RequestParam(value="offset",defaultValue = "0",required = false) int pageNum,
                           @RequestParam(value="limit",defaultValue = "10",required = false) int pageSize){
        PageUtils pageUtils=ts.getAllInfo(pageNum,pageSize);
        return pageUtils;
    }

}
